<!DOCTYPE html>
            
<HTML>
<HEAD>
<meta name="booktitle" content="Developing Applications With Objective Caml" >
 <meta charset="ISO-8859-1"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<META name="GENERATOR" content="hevea 1.05-7 of 2000-02-24">
<META NAME="Author" CONTENT="Christian.Queinnec@lip6.fr">
<LINK rel=stylesheet type="text/css" href="videoc-ocda.css">
<script language="JavaScript" src="videoc.js"><!--
//--></script>
<TITLE>
 Basic notions
</TITLE>
</HEAD>
<BODY class="regularBody">
<A HREF="book-ora046.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="book-ora048.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2> Basic notions</H2>
Graphics programming is tightly bound to the technological evolution of
hardware, in particular to that of screens and graphics cards. In order
to render images in sufficient quality, it is necessary that the drawing
be refreshed (redrawn) at regular and short intervals, somewhat like in
a cinema. There are basically two techniques for drawing on the screen:
the first makes use of a list of visible segments where only the useful
part of the drawing is drawn, the second displays all points of the
screen (bitmap screen). It is the last technique which is used on
ordinary computers.<BR>
<BR>
Bitmap screens can be seen as rectangles of accessible, in other terms,
displayable points. These points are called pixels, a word
derived from <EM>picture element</EM>. They are the basic elements for
constructing images. The height and width of the main bitmap is the
resolution of the screen. The size of this bitmap therefore depends on
the size of each pixel. In monochrome (black/white) displays, a pixel can
be encoded in one bit. For screens that allow gray scales or for color
displays, the size of a pixel depends on the number of different colors
and shades that a pixel may take. In a bitmap of 320x640 pixels with 256
colors per pixel, it is therefore necessary to encode a pixel in 8 bits,
which requires video memory of: 480 * 640 bytes = 307200 bytes <U>~</U>
300KB. This resolution is still used by certain MS-DOS programs.<BR>
<BR>
The basic operations on bitmaps which one can find in the
<TT>Graphics</TT> library are:
<UL>
<LI>
 coloration of pixels,

<LI> drawing of pixels,

<LI> drawing of forms: rectangles, ellipses,

<LI> filling of closed forms: rectangles, ellipses, polygons,

<LI> displaying text: as bitmap or as vector,

<LI> manipulation or displacement of parts of the image.
</UL>
All these operations take place at a reference point, the one
of the bitmap. A certain number of characteristics of these graphical
operations like the width of strokes, the joints of lines, the choice of
the character font, the style and the motive of filling define what we
call a graphical context. A graphical operation always happens
in a particular graphical context, and its result depends on it. The
graphical context of the <TT>Graphics</TT> library does not contain
anything except for the current point, the current color, the current
font and the size of the image.<BR>
<BR>
<HR>
<A HREF="book-ora046.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="book-ora048.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
